package 面试相关;

public class 华为1 {
    public boolean canJump(int[] nums) {
        int right = nums[0];
        for(int i = 0; i <= right; i++){
            right = Math.max(right,i + nums[i]);
            if(right >= nums.length - 1){
                return true;
            }
        }
        return false;
    }
}
